<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('收单', ~{::title}, ~{::content}, ~{::script})}"
      xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>工单管理-收单</title>
</head>
<body>

<div th:fragment="content">
    <style>
        .layui-form-item {
            margin-bottom: 20px;
        }

        .d-marginleft-10 {
            margin-left: 10px;
        }

        .d-marginright-30 {
            margin-right: 30px;
        }

        .layui-form-item .d-nopaddinglr {
            padding-left: 0;
            padding-right: 0;
        }

        .layui-form-item .d-label-56 {
            width: 56px;
        }

        .d-text-center {
            padding-left: 65px;
        }

        .d-margintop-35 {
            margin-top: 35px;
        }

        .layui-form-item .d-width-1 {
            width: 150px;
            height: 40px;
            line-height: 40px;
            padding-left: 10px;
            box-sizing: border-box;
            margin-right: 0;
            font-size: 14px;
            border: 1px solid #d2d2d2;
            border-bottom: none;
        }
        .d-clearmarginbtm{
            margin-bottom: 0;
        }


        .d-item{
            font-size: 0px;
        }
        .d-item .d-inline{
            display: inline-block;
        }
        .layui-form-item .applique-list{
            width: auto;
        }
        .applique-list > img{
            width: 120px;
            height: 100px;
            margin-bottom: 10px;
            margin-right: 10px;
        }
        .table-tpl{
            border: none;
            background: none;
            width: 100%;
            height: 100%;
        }
        .layui-table tbody tr:hover{
            background-color: transparent !important;
        }
        .input-border{
            border: 1px solid #ccc;
            padding: 0 5px;
        }
        .table-text tr td {
            text-align: center;
        }
        .table-text tr th {
            text-align: center;
        }
        .table-text input {
            text-align: center;
        }
    </style>
    <div  th:if="${checkOutVO.platWork == 10 || checkOutVO.platWork == 40}">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 60px"><b>工单金额</b></label>
                <div class="layui-inline" style="width: 700px;">
                    <table class="layui-table table-text">
                        <thead>
                            <tr>
                                <th>原价</th>
                                <th>优惠</th>
                                <th>订单收入</th>
                                <th:block th:if="${checkOutVO.type == 1}">
                                    <th>订单内部价/总价</th>
                                </th:block>
                                <th>配件总额</th>
                                <th>配件占比</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                   <span th:if="${checkOutVO.originalAmount}"
                                         th:text="|${#moneyUtil.parseToYuanStr(checkOutVO.originalAmount)}|">
                                   </span>
                                </td>
                                <td>
                                   <span th:if="${checkOutVO.discountAmount}"
                                         th:text="|${#moneyUtil.parseToYuanStr(checkOutVO.discountAmount)}|">
                                   </span>
                                </td>
                                <td>
                                   <span th:if="${checkOutVO.totalAmount}"
                                         th:text="|${#moneyUtil.parseToYuanStr(checkOutVO.totalAmount)}|">
                                   </span>
                                </td>
                                <th:block th:if="${checkOutVO.type == 1}">
                                    <td>
                                       <span id="internalTotalPrice" th:if="${checkOutVO.internalTotalPrice}"
                                             th:text="|${#moneyUtil.parseToYuanStr(checkOutVO.internalTotalPrice)}|">
                                       </span>
                                    </td>
                                </th:block>
                                <td>
                                   <span th:if="${checkOutVO.partAmount}"
                                         th:text="|${#moneyUtil.parseToYuanStr(checkOutVO.partAmount)}|">
                                   </span>
                                </td>
                                <td>
                                   <span th:if="${checkOutVO.proportionAmount}"
                                         th:text="${checkOutVO.proportionAmount} + '%'">
                                   </span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <th:block th:if="${checkOutVO.type == 1}">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 60px"><b>收费项目</b></label>
                    <div class="layui-inline" style="width: 700px;">
                        <table class="layui-table table-text">
                            <thead>
                            <tr>
                                <th>项目名称</th>
                                <th>数量</th>
                                <th>内部价/单价</th>
                                <th>内部价/总价</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="serviceItem : ${checkOutVO.orderServiceItemList}">
                                <td class="service-item-name" th:text="${serviceItem.servItemName}"></td>
                                <td class="item-number" th:text="${serviceItem.number}"></td>
                                <td>
                                    <input th:data-service-item-id="${serviceItem.servItemId}"
                                           th:data-pro-ext-id="${serviceItem.proExtId}"
                                           type="text" class="layui-input" name="internalSettlementPrice"
                                           th:value="|${#moneyUtil.parseToYuanStr(serviceItem.internalSettlementPrice)}|">
                                </td>
                                <td>
                                    <input th:data-service-item-id="${serviceItem.servItemId}"
                                           th:data-pro-ext-id="${serviceItem.proExtId}"
                                           type="text" class="layui-input" name="internalTotalPrice"
                                           th:value="|${#moneyUtil.parseToYuanStr(serviceItem.internalTotalPrice)}|">
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-inline" style="color: #c2c2c2">内部价将用于：工程师和服务商的提留</div>
                </div>
            </div>
        </th:block>

    </div>
    <form action="" class="layui-form " onkeydown="if(event.keyCode==13){return false}">
        <input type="text" hidden name="orderId" th:value="${checkOutVO.orderId}">
        <input type="text" hidden name="workId" th:value="${checkOutVO.workId}">
        <input type="text" hidden name="plat" th:value="${checkOutVO.plat}">
        <input type="text" hidden name="platWork" th:value="${checkOutVO.platWork}">

        <div class="layui-form-item">
            <label class="layui-form-label d-nopaddinglr d-label-56">工单结果</label>
            <div class="layui-input-inline d-marginleft-10">

                <th:block th:if="${checkOutVO.checkOutConf.editStatus == 1}">
                    <select name="resultStatus" id="orderesult-select" disabled>
                        <option value="2" th:attr="selected=${checkOutVO.resultStatus == 2 ? true : false}">成功</option>
                        <option value="3" th:attr="selected=${checkOutVO.resultStatus == 3 ? true : false}">失败</option>
                    </select>
                </th:block>
                <th:block th:unless="${checkOutVO.checkOutConf.editStatus == 1}">
                    <select name="resultStatus" id="orderesult-select">
                        <option value="2" th:attr="selected=${checkOutVO.resultStatus == 2 ? true : false}">成功</option>
                        <option value="3" th:attr="selected=${checkOutVO.resultStatus == 3 ? true : false}">失败</option>
                    </select>
                </th:block>
            </div>
            <p style="margin-top: 5px;">结果：将影响工程师的相关绩效</p>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label d-nopaddinglr d-label-56">备注</label>
            <div class="layui-input-inline d-marginleft-10" style="width:800px">
                <textarea placeholder="请输入内容,最多1000字" maxlength="1000" lay-verify="length" name="operatorRemark"
                          class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item d-text-center d-margintop-35">
            <button class="layui-btn layui-bg-green" lay-submit="" lay-filter="save-btn">保存</button>
            <!--<button class="layui-btn layui-btn-primary" type="reset">重置</button>-->
        </div>
    </form>
</div>


<script th:inline="javascript">
    var masterList = [[${checkOutVO}]];
    console.log("masterList",masterList);

    var layuiModel = {
         oms_work_modify_checkout: "work/modify/zmn.oms.work.modify.checkout"
    };
</script>
</body>
</html>
